package patterns.prototype;

/**
 * Created by lenovo on 2016/11/23 0023.
 * 演示原型模式的使用
 */
public class PrototypePatternDemo {
    public static void main(String[] args) {
        //先加载模拟获取到实例对象的原型
        ShapeCache.loadCache();

        //获取实例对象的clone
        AbsShape shape1 = ShapeCache.getShape("1");
        System.out.println("图形是：" + shape1.getType());
        AbsShape shape2 = ShapeCache.getShape("2");
        System.out.println("图形是：" + shape2.getType());
        AbsShape shape3 = ShapeCache.getShape("3");
        System.out.println("图形是：" + shape3.getType());
    }
}
